#ifndef TESTMODEL_H
#define TESTMODEL_H

#include <QObject>

class StationModel : public QObject
{
    Q_OBJECT
    Q_PROPERTY(QString text READ text WRITE setText NOTIFY statusChanged)
    Q_PROPERTY(QString MN READ getMN WRITE setMN NOTIFY statusChanged)
    Q_PROPERTY(QString PW READ getPW WRITE setPW NOTIFY statusChanged)
    Q_PROPERTY(QString OverTime READ getOverTime WRITE setOverTime NOTIFY statusChanged)
    Q_PROPERTY(QString ReCount READ getReCount WRITE setReCount NOTIFY statusChanged)
    Q_PROPERTY(QString SystemTime READ getSystemTime WRITE setSystemTime NOTIFY statusChanged)
    Q_PROPERTY(QString RtdInterval READ getRtdInterval WRITE setRtdInterval NOTIFY statusChanged)
    Q_PROPERTY(QString MinInterval READ getMinInterval WRITE setMinInterval NOTIFY statusChanged)
    Q_PROPERTY(QString RealtimeReport READ getRealtimeReport WRITE setRealtimeReport NOTIFY statusChanged)
    Q_PROPERTY(QString DeviceStateView READ getDeviceStateView WRITE setDeviceStateView NOTIFY statusChanged)
    Q_PROPERTY(QString RestartTime READ getRestartTime WRITE setRestartTime NOTIFY statusChanged)
    Q_PROPERTY(QString SoftCurrVer READ getSoftCurrVer WRITE setSoftCurrVer NOTIFY statusChanged)
    Q_PROPERTY(QString SoftOnlineVer READ getSoftOnlineVer WRITE setSoftOnlineVer NOTIFY statusChanged)
    Q_PROPERTY(bool NeedUpdate READ getNeedUpdate WRITE setNeedUpdate NOTIFY statusChanged)

public:
    explicit StationModel(QObject *parent = nullptr) : QObject(parent) {}
    QString text() { return m_text; }

    void setText(QString text) {
        m_text = text;
        emit statusChanged();
    }

    QString getMN() { return _MN; }
    void setMN(QString text) {_MN = text; emit statusChanged();}

    QString getPW() { return _PW; }
    void setPW(QString text) {_PW = text; emit statusChanged();}

    QString getOverTime() { return _OverTime; }
    void setOverTime(QString text) {_OverTime = text; emit statusChanged();}

    QString getReCount() { return _ReCount; }
    void setReCount(QString text) {_ReCount = text; emit statusChanged();}

    QString getSystemTime() { return _SystemTime; }
    void setSystemTime(QString text) {_SystemTime = text; emit statusChanged();}

    QString getRtdInterval() { return _RtdInterval; }
    void setRtdInterval(QString text) {_RtdInterval = text; emit statusChanged();}

    QString getMinInterval() { return _MinInterval; }
    void setMinInterval(QString text) {_MinInterval = text; emit statusChanged();}

    QString getRealtimeReport() { return _RealtimeReport; }
    void setRealtimeReport(QString text) {_RealtimeReport = text; emit statusChanged();}

    QString getDeviceStateView() { return _DeviceStateView; }
    void setDeviceStateView(QString text) {_DeviceStateView = text; emit statusChanged();}


    QString getRestartTime() { return _RestartTime; }
    void setRestartTime(QString text) {_RestartTime = text; emit statusChanged();}

    QString getSoftCurrVer() { return _SoftCurrVer; }
    void setSoftCurrVer(QString text) {_SoftCurrVer = text; emit statusChanged();}

    QString getSoftOnlineVer() { return _SoftOnlineVer; }
    void setSoftOnlineVer(QString text) {_SoftOnlineVer = text; emit statusChanged();}

    bool getNeedUpdate() { return _NeedUpdate; }
    void setNeedUpdate(bool text) {_NeedUpdate = text; emit statusChanged();}






signals:
    void statusChanged();

private:
    QString m_text="txtTest";
    QString _MN="000000000000000000001111";
    QString _PW="000000";
    QString _RestartTime="20190101000000";
    QString _SystemTime="20190101000000";
    QString _OverTime="0";
    QString _ReCount="0";
    QString _RtdInterval="30";
    QString _MinInterval="1";
    QString _RealtimeReport="否";
    QString _DeviceStateView="否";
    QString _SoftCurrVer="190910B";
    QString _SoftOnlineVer="";
    bool _NeedUpdate=false;


};

#endif // TESTMODEL_H
